package cn.yuanqiao.activiti.listener;

import cn.yuanqiao.activiti.domain.ActArchiveData;
import cn.yuanqiao.activiti.service.IActArchiveDataService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @ClassName: WritsArchiveBorrowListener
 * @Description: 类的描述
 * @author: lihuahua
 * @date: 2023/6/5 19:24
 * @Blog: huahuacoco.top
 */
@Component("ArchiveEndListener")
public class ArchiveEndListener implements ExecutionListener {

    @Autowired
    private IActArchiveDataService actArchiveDataService;

    @Override
    public void notify(DelegateExecution execution) {
        String processInstanceId = execution.getProcessInstanceId();
        Object archiveData = execution.getVariable("archiveData");
        System.out.println("结束流程监听类，维护actArchiveData表");
        new ActArchiveData();
        int i = actArchiveDataService.updateActArchiveDataEndByDeployId(processInstanceId);
    }
}
